﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Data;

namespace CommunitySystemModel
{
    [Serializable]
    [DataContract]
  public  class Emp_CJJS
    {
        private int _Id;
         [DataMember]
        public int Id
        {
            get { return _Id; }
            set { _Id = value; }
        }
         private string _Name;
         [DataMember]
         public string Name
         {
             get { return _Name; }
             set { _Name = value; }
         }
         private int _Eid;
         [DataMember]
         public int Eid
         {
             get { return _Eid; }
             set { _Eid = value; }
         }
         private string _CardNo;
         [DataMember]
         public string CardNo
         {
             get { return _CardNo; }
             set { _CardNo = value; }
         }
         private string _OldDW;
         [DataMember]
         public string OldDW
         {
             get { return _OldDW; }
             set { _OldDW = value; }
         }
         private string _OldKS;
         [DataMember]
         public string OldKS
         {
             get { return _OldKS; }
             set { _OldKS = value; }
         }
         private string _OldZW;
         [DataMember]
         public string OldZW
         {
             get { return _OldZW; }
             set { _OldZW = value; }
         }
         private string _OldZWCC;
         [DataMember]
         public string OldZWCC
         {
             get { return _OldZWCC; }
             set { _OldZWCC = value; }
         }
         private string _OldZWSX;
         [DataMember]
         public string OldZWSX
         {
             get { return _OldZWSX; }
             set { _OldZWSX = value; }
         }
         private string _NewDW;
         [DataMember]
         public string NewDW
         {
             get { return _NewDW; }
             set { _NewDW = value; }
         }
         private int _DWID;
         [DataMember]
         public int DWID
         {
             get { return _DWID; }
             set { _DWID = value; }
         }
         private string _BGRQ;
         [DataMember]
         public string BGRQ
         {
             get { return _BGRQ; }
             set { _BGRQ = value; }
         }
         private string _NewKS;
         [DataMember]
         public string NewKS
         {
             get { return _NewKS; }
             set { _NewKS = value; }
         }
         private string _DutyName;
         [DataMember]
         public string DutyName
         {
             get { return _DutyName; }
             set { _DutyName = value; }
         }
        
         private string _DutyLevel;
         [DataMember]
         public string DutyLevel
         {
             get { return _DutyLevel; }
             set { _DutyLevel = value; }
         }
         private string _DutyAttribute;
         [DataMember]
         public string DutyAttribute
         {
             get { return _DutyAttribute; }
             set { _DutyAttribute = value; }
         }
         private string _CreateUser;
         [DataMember]
         public string CreateUser
         {
             get { return _CreateUser; }
             set { _CreateUser = value; }
         }
         private DateTime? _CreateDate;
         [DataMember]
         public DateTime? CreateDate
         {
             get { return _CreateDate; }
             set { _CreateDate = value; }
         }
         private bool isselected = false;
         [DataMember]
         public bool IsSelected
         {
             get { return isselected; }
             set { isselected = value; }
         }
         private int _Sequence;
         [DataMember]
         public int Sequence
         {
             get { return _Sequence; }
             set { _Sequence = value; }
         }
         public static Emp_CJJS FillEntity(DataRow dr)
         {
             Emp_CJJS right = new Emp_CJJS();
             right.IsSelected = dr["IsSelected"].ToString() == "false" ? false : true;
             right.Sequence = Convert.ToInt32(dr["Sequence"]);
             if (dr.Table != null && dr.Table.Columns.Contains("Id"))
                 right.Id = Convert.ToInt32(dr["Id"]);
             if (dr.Table != null && dr.Table.Columns.Contains("Name"))
                 if (!string.IsNullOrEmpty(dr["Name"].ToString())) right.Name = dr["Name"].ToString();
             if (dr.Table != null && dr.Table.Columns.Contains("CardNo"))
                 if (!string.IsNullOrEmpty(dr["CardNo"].ToString())) right.CardNo = dr["CardNo"].ToString();
             if (dr.Table != null && dr.Table.Columns.Contains("EID"))
                 if (!string.IsNullOrEmpty(dr["EID"].ToString()))
                     right.Eid = Convert.ToInt32(dr["EID"]);
             if (dr.Table != null && dr.Table.Columns.Contains("OldDW"))
                 if (!string.IsNullOrEmpty(dr["OldDW"].ToString())) right.OldDW = dr["OldDW"].ToString();
             if (dr.Table != null && dr.Table.Columns.Contains("OldKS"))
                 if (!string.IsNullOrEmpty(dr["OldKS"].ToString())) right.OldKS = dr["OldKS"].ToString();
             if (dr.Table != null && dr.Table.Columns.Contains("OldZW"))
                 if (!string.IsNullOrEmpty(dr["OldZW"].ToString())) right.OldZW = dr["OldZW"].ToString();
             if (dr.Table != null && dr.Table.Columns.Contains("OldZWCC"))
                 if (!string.IsNullOrEmpty(dr["OldZWCC"].ToString())) right.OldZWCC = dr["OldZWCC"].ToString();
             if (dr.Table != null && dr.Table.Columns.Contains("OldZWSX"))
                 if (!string.IsNullOrEmpty(dr["OldZWSX"].ToString())) right.OldZWSX = dr["OldZWSX"].ToString();

             if (dr.Table != null && dr.Table.Columns.Contains("BGRQ")) right.BGRQ = Convert.ToDateTime(dr["BGRQ"]).ToString("yyyy-MM-dd");
             if (dr.Table != null && dr.Table.Columns.Contains("NewDW"))
                 if (!string.IsNullOrEmpty(dr["NewDW"].ToString())) right.NewDW = dr["NewDW"].ToString();
             if (dr.Table != null && dr.Table.Columns.Contains("DWID"))
                 right.DWID = Convert.ToInt32(dr["DWID"]);
             if (dr.Table != null && dr.Table.Columns.Contains("NewKS"))
                 if (!string.IsNullOrEmpty(dr["NewKS"].ToString())) right.NewKS = dr["NewKS"].ToString();
             if (dr.Table != null && dr.Table.Columns.Contains("DutyName"))
                 if (!string.IsNullOrEmpty(dr["DutyName"].ToString())) right.DutyName = dr["DutyName"].ToString();
             if (dr.Table != null && dr.Table.Columns.Contains("DutyLevel"))
                 if (!string.IsNullOrEmpty(dr["DutyLevel"].ToString())) right.DutyLevel = dr["DutyLevel"].ToString();
             if (dr.Table != null && dr.Table.Columns.Contains("DutyAttribute"))
                 if (!string.IsNullOrEmpty(dr["DutyAttribute"].ToString())) right.DutyAttribute = dr["DutyAttribute"].ToString();
             if (dr.Table != null && dr.Table.Columns.Contains("CreateUser"))
                 if (!string.IsNullOrEmpty(dr["CreateUser"].ToString())) right.CreateUser = dr["CreateUser"].ToString();
             if (dr.Table != null && dr.Table.Columns.Contains("CreateDate"))
                 if (!string.IsNullOrEmpty(dr["CreateDate"].ToString())) right.CreateDate = Convert.ToDateTime(dr["CreateDate"].ToString());
             return right;
         }
	
    }
}
